<template>
  <view class="content">
    <image class="successImg" src="/static/img/success.png"/>
    <view class="success">{{ type||'提交成功' }}</view>
    <view class="successInfo">{{ time }}</view>


    <image class="box-img6" src="/static/img/index7.jpg" mode="widthFix" @click="goEtcManage"></image>

    <view class="msg">
      <image src="/static/img/notice.png" mode="widthFix" />
      <view>未注销用户可先发货，注销之后激活即可使用</view>
    </view>

    <view class="btn">
<!--      <view class="details" @click="goIndex">返回首页</view>-->
      <view class="share" @click="goEtcManage">立即办理</view>
    </view>

  </view>
</template>

<script lang="ts">
// @ts-nocheck
import Vue from "vue";
import {getEtcCancelStmpIdList} from "../../api/api";
import {timeTodayTime} from "../../utils/times";

export default Vue.extend({
  data() {
    return {
      img: "",
      content: "",
      time:'',
      type:'',//1.支付类型 2.删除类型 3.资料提交成功
    };
  },
  async onLoad(options) {

    let date = new Date()
    this.time = timeTodayTime(date)
    this.type = options.type||'';
    this.getOrderStates(options.type);//获取成功的类型
    // const data = await getEtcCancelStmpIdList();
    // console.log("订阅消息", data)
    // uni.requestSubscribeMessage({
    //   tmplIds: data,
    //   success(res) {
    //     console.log('订阅消息-成功', res)
    //   },
    //   fail(res) {
    //     console.log('订阅消息-失败', res)
    //   }
    // })

  },
  async onShow() {
  },
  methods: {
    // 返回首页
    goIndex(){
      uni.navigateTo({
        url:'/pages/index/index'
      })
    },

    // 立即办理
    goEtcManage(){
      uni.redirectTo({
        url: '/pages/index/select-pay'
      })
    },
    getOrderStates(key) {
      switch (key) {
        case '1':
          this.type = "支付成功"
          break
        case '2':
          this.type = "删除成功"
          break
        case '3':
          this.type = "资料提交成功"
          break
      }
    },
  },
});
</script>

<style scoped>
.content {
  margin: 85rpx auto 0;
  text-align: center;
}

.successImg {
  width: 160rpx;
  height: 160rpx;
  border-radius: 50%;
}

.success {
  font-size: 40rpx;
  font-weight: 800;
  color: #000000;
  margin: 35rpx 0;
}

.successInfo {
  font-size: 28rpx;
  color: #B0BDB0;
}

.msg {
  font-size: 26rpx;
  color: #333333;
  display: flex;
  justify-content: center;
}

.msg image {
  width: 32rpx;
  height: 32rpx;
  margin-right: 12rpx;
}

.btn {
  margin: 79rpx 0 51rpx;
  display: flex;
  justify-content: flex-end;
}

.details {
  width: 212rpx;
  height: 86rpx;
  border: 2rpx solid #D7D7D7;
  border-radius: 43rpx;
  font-size: 30rpx;
  color: #000000;
  line-height: 86rpx;
  text-align: center;
  margin-right: 75rpx;
}

.share {
  width: 660rpx;
  height: 86rpx;
  background: #1A6FFD;
  border-radius: 43rpx;
  font-size: 30rpx;
  color: #FFFFFF;
  line-height: 86rpx;
  text-align: center;
  margin-right: 50rpx;
}

.box-img6 {
  width: 100%;
  height: 691rpx;
  margin-top: 36rpx;
  margin-bottom: 26rpx;
}
</style>
